package com.pic.others.controller;


import com.pic.common.utils.R;
import com.pic.common.utils.UserContext;
import com.pic.others.domain.po.Notice;
import com.pic.others.mapper.NoticeMapper;
import com.pic.others.service.IBottleService;
import com.pic.others.service.INoticeService;
import com.pic.others.service.impl.NoticeServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;


@RestController
@RequiredArgsConstructor
@RequestMapping("/bottle")
@Api("关于漂流瓶操作")
@Slf4j
public class BottleController {
    private final IBottleService bottleServicel;



    @ApiOperation("发送漂流瓶")
    @PostMapping("/send")
    public R<String> addBottle(@RequestBody  String sendContent){
        log.info("发送漂流瓶");
        return bottleServicel.addBottle(sendContent);
    }

    @ApiOperation("接受漂流瓶")
    @GetMapping("/getbottle")
    public R<String>getButton(){
        return bottleServicel.getBottle();
    }

    @ApiOperation("获取根据用户行为获取的漂流瓶")
    @GetMapping()
    public R<Notice>getNotice(){
        return bottleServicel.getNoticeByAuto();
    }


}
